const Router = require('@koa/router');
// Koa 的路由在被 use 时是无法指定前缀的, 需要在定义时就指定前缀
const router = Router({
    prefix: '/api/user'
});

const userController = require('../controllers/userController')

// 组装路由
router.post('/sendPhoneCode', userController.sendPhoneCode);
router.post('/loginByPhoneCode', userController.loginByPhoneCode);
router.post('/registerUser', userController.registerUser);
router.get('/', userController.listAll);
router.get('/userInfo', userController.userInfo);
router.post('/loginUser', userController.loginUser);
router.post('/logoutUser', userController.logoutUser);
router.post('/updatePassword', userController.updatePassword);
module.exports = router.routes();
